import Vue from 'vue'
import App from './App.vue'
import router from './router'
import '../src/assets/css/global.css'
import './plugins/element.js'
import './assets/fonts/iconfont.css'

import ZkTable from 'vue-table-with-tree-grid'

// 导入富文本编辑器
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme



// 导入axios
import axios from 'axios'



axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'



axios.interceptors.request.use(config => {
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})

Vue.prototype.$http = axios

Vue.config.productionTip = false

Vue.component('tree-table', ZkTable)

Vue.filter('dataFormat',(item) => {
  let value = new Date(item)
  let str = ''
  let y = value.getFullYear()
  let m = value.getMonth() + 1
  let d = value.getDate()
  str = y + '-' + m + '-' + d
  return str
})
// 全局注册
Vue.use(VueQuillEditor, /* { default global options } */)

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
